package com.ld.security.server.admin.modules.msg.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ld.security.common.core.anno.IdKey;
import com.ld.security.common.mybatis.anno.LabelKey;
import com.ld.security.common.mybatis.anno.LabelKeys;
import com.ld.security.common.mybatis.anno.SqlKey;
import com.ld.security.common.mybatis.base.entity.SuperEntity;
import com.ld.security.common.mybatis.constant.SqlCondition;
import com.ld.security.auth.common.sys.entity.SysUserEntity;
import com.ld.security.server.admin.modules.msg.constant.MsgGroupNewsUserRelConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@TableName("msg_group_news_user_rel")
@ApiModel("群用户消息关联")
@Data
public class MsgGroupNewsUserRelEntity  extends SuperEntity
{

  @ApiModelProperty("用户编号")
  @SqlKey(SqlCondition.eq)
  @LabelKeys(value = SysUserEntity.class,labels = {
          @LabelKey(sourceKey = "label",targetKey = "userName")
  })
    private String userId;



  @ApiModelProperty("群编号")
  @SqlKey(SqlCondition.eq)
  @LabelKeys(value = MsgGroupEntity.class,labels = {
          @LabelKey(sourceKey = "label",targetKey = "groupName")
  })
    private String groupId;




  @ApiModelProperty("消息编号")
  @SqlKey(SqlCondition.eq)
    private String newsId;


  @ApiModelProperty("消息状态")
  @SqlKey(SqlCondition.eq)
  private MsgGroupNewsUserRelConstant.msgStatus msgStatus;

  @ApiModelProperty("用户名称")
  @SqlKey(SqlCondition.eq)
  private String userName;


  @ApiModelProperty("群组名称")
  @SqlKey(SqlCondition.eq)
  private String groupName;

  @IdKey({"userId","newsId"})
  @Override
  public String getId() {
    return super.getId();
  }
}
